#include<iostream>
#include<cstdio>
#include<cstring>
#include<deque>
using namespace std;
int n,t;
int a[10000],c[10000];
bool b[10010];
deque<int> x,y;
void read(int &x){
	x=0;int f=1;char c=0;
	while(c<'0'||c>'9'){
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=x*10+c-'0';
		c=getchar();
	}
	x=x*f;
}
void dfs(int s)
{
	if(s>2*n){
		y.clear();
		memset(c,0,sizeof(c));
		for(int i=1;i<=2*n;i++) x.push_back(a[i]);
		for(int i=1;i<=2*n;i++){
			if(b[i]){
				y.push_back(x.front());
				x.pop_front();
			}else{
				y.push_front(x.back());
				x.pop_back();
			}
		}
		for(int i=1;i<=2*n;i++){
			c[i]=y.front();
			y.pop_front();
		}
		for(int i=1;i<=2*n;i++){
			if(c[i]!=c[2*n-i+1]) return;
		}
		for(int i=1;i<=2*n;i++){
			if(!b[i]) putchar('L');
			else putchar('R');
		}
		exit(0);
	}else{
		b[s]=0;
		dfs(s+1);
		b[s]=1;
		dfs(s+1);
	}
}
int main()
{
	int i,j;
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	read(t);
	while(t--){
		read(n);
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		x.clear();
		for(i=1;i<=2*n;i++) read(a[i]),x.push_back(a[i]);
		dfs(1);
		for(i=1;i<=2*n;i++){
			if(!b[i]){
				putchar('\n');
				goto flag;
			}
		}
		puts("-1");
		flag:;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
